<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/manage/common/taglibs.jsp"%>

<script type="text/javascript">
function manage_resource_actionFormatter(value,row,index){
  var actions = formatString($('#manage_resource_action_normal').html(),row.id);
  if(row.menu.showState == 0){
    actions += formatString($('#manage_resource_action_move').html(),row.id);
  }
  return actions;
}

/**
 * 页面加载完成后执行
 */
$(function() {
  //注册按键回车直接提交查询
  $.acooly.framework.registerKeydown('manage_resource_toolbar','manage_resource_datagrid');
});


</script>



<div class="easyui-layout" data-options="fit : true,border : false">
  <!-- 列表和工具栏 -->
  <div data-options="region:'center',border:false">
    <table id="manage_resource_datagrid" class="easyui-datagrid" url="${pageContext.request.contextPath}/manage/system/resource/listJson.html" toolbar="#manage_resource_toolbar" fit="true" border="false" fitColumns="true"
      pagination="true" idField="id" pageSize="20" pageList="[ 10, 20, 30, 40, 50 ]" sortName="id" sortOrder="desc" checkOnSelect="true" selectOnCheck="true"
      data-options="view:groupview, groupField:'menu', groupFormatter:function(value,rows){ return ($(value).attr('name')?$(value).attr('name'):'系统资源(不显示)') + ' - ' + rows.length;}">
      <thead>
        <tr>
          <th field="formatId" checkbox="true" data-options="formatter:function(value, row, index){ return row.id }">编号</th>
          <th field="id" width="40">编号</th>
          <th field="name" width="100">名称</th>
          <th field="resType" width="50">类型</th>
          <th field="showMode" width="50" data-options="formatter:function(value){ return formatRefrence('manage_resource_datagrid','allShowModes',value); }">加载方式</th>
          <th field="resString" width="100">资源</th>
          <th field="icon" width="50" data-options="formatter:formatIcon">图标</th>
          <th field="action" width="100" data-options="formatter:manage_resource_actionFormatter">动作</th>
        </tr>
      </thead>
    </table>
    
    <div id="manage_resource_action_normal" style="display: none;">
      <a onclick="$.acooly.framework.edit({url:'/manage/system/resource/edit.html',id:{0},entity:'resource',width:550,height:500,reload:true})" href="#"><img title="编辑" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/edit.png" border="0"/></a>&nbsp
      <a onclick="$.acooly.framework.remove('/manage/system/resource/deleteJson.html',{0},'manage_resource_datagrid');" href="#"><img title="删除" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/plugin/jquery-easyui-1.3.1/themes/icons/delete.png" border="0"/></a>
    </div>
    <div id="manage_resource_action_move" style="display: none;">
       <a onclick="$.acooly.framework.move('/manage/system/resource/moveTop.html',{0},'manage_resource_datagrid');" href="#"><img title="置顶" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/style/icons/action/movetop.png" border="0"/></a>
      <a onclick="$.acooly.framework.move('/manage/system/resource/moveUp.html',{0},'manage_resource_datagrid');" href="#"><img title="上移" style="width:16px;height:16px;vertical-align:middle;" src="${pageContext.request.contextPath}/manage/style/icons/action/moveup.png" border="0"/></a>     
    </div>
    
    
    <div id="manage_resource_toolbar">
            资源名称:<input type="text" size="10" name="search_LIKE_name" />
      <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="$.acooly.framework.search('manage_resource_toolbar','manage_resource_datagrid');">查询</a>
      <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="$.acooly.framework.create({url:'/manage/system/resource/create.html',entity:'resource',width:550,height:500,reload:true})">添加</a> 
      <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="$.acooly.framework.removes('/manage/system/resource/deleteJson.html','manage_resource_datagrid')">批量删除</a>
    </div>
  </div>

</div>
